package com.difsonapps.android.marker.dialogs;

import com.difsonapps.android.marker.IRefresher;
import com.difsonapps.android.marker.MainActivity;
import com.difsonapps.android.marker.R;

import android.app.Dialog;
import android.content.Context;
import android.view.View;


public class MenuSharePhotoDialog extends Dialog{
	IRefresher<Integer> executer;
	//MainActivity activity;
	
	
	public MenuSharePhotoDialog(Context context, IRefresher<Integer> executer) {
		super(context, R.style.mydialogstyle);
		this.executer = executer;
		setTitle(R.string.share_on);
		
		setContentView(R.layout.dialog_menu_share_photo);
		findViewById(R.id.mark_it_button).setOnClickListener(new View.OnClickListener() {
			@Override
			public void onClick(View v) {
				shareOnMarkIt();
			}
		});
		findViewById(R.id.facebook_button).setOnClickListener(new View.OnClickListener() {
			@Override
			public void onClick(View v) {
				shareOnFacebook();
			}
		});
		findViewById(R.id.cancel_button).setOnClickListener(new View.OnClickListener() {
			@Override
			public void onClick(View v) {
				cancelAction();
			}
		});
	}
	
	private void shareOnMarkIt(){
		dismiss();
		executer.refresh(1);
	}
	
	private void shareOnFacebook(){
		dismiss();
		executer.refresh(2);
	}
	
	private void cancelAction(){
		dismiss();
	}

}
